const obj = {
  name: 'zhangsan',
};

const p = new Proxy(obj, {
  /**
   *
   * @param {*} target 源对象
   * @param {*} prop 访问的属性名
   * @param {*} receiver 当前Proxy对象
   * @returns
   */
  get: (target, prop, receiver) => {
    console.log(target, prop, receiver);
    return target[prop];
  },
});

console.log(p.name); // 可以被拦截
// Object.create(p).name; // 可以被拦截
